<!DOCTYPE html>
{% load static %}
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div class="title">
    <h1 style="text-align: center">图书管理系统</h1>
</div>
<a href="{% url "app1:addbook" %}">
    <button>添加书籍</button>
</a>

<form action={% url 'app1:search' %}>
    <input type="search" name="name">
    <input type="submit" value="搜索">
</form>

<div>
    <h2>书籍列表</h2>
    <table border="1" cellspacing="0">
        <tr align="center">
            <th>ID</th>
            <th>书名</th>
            <th>价格</th>
            <th>编号</th>
            <th>作者</th>
            <th colspan="2">操作</th>
        </tr>
        {% for book in pager.object_list %}
        <tr align="center">
            <td>{{ book.id }}</td>
            <td>{{ book.name }}</td>
            <td>{{ book.price }}</td>
            <td>{{ book.isbn_no }}</td>
            <td>{{ book.enterperson }}</td>
            <td><a href="{% url "app1:delbook" book.id %}">删除</a></td>
            <td><a href="{% url "app1:editbooks" book.id %}">修改</a></td>
        </tr>
        {% endfor %}
    </table>
    <br>
    <br>
</div>
{% for page in paginator.page_range %}
    <a href={% url 'app1:search' page=page %}?name={{ name }}>{{ page }}</a>
{% endfor %}
<br>
<div align="center">
    有问题请联系站主,qing@qq.com
</div>
</body>
</html>
